/*
 * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.matezk.dms.system.model.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import top.continew.starter.extension.crud.model.req.BaseReq;

import java.io.Serial;

/**
 * 创建或修改模板参数
 *
 * @author 程道林
 * @since 2025/01/06 15:08
 */
@Data
@Schema(description = "创建或修改模板参数")
public class TemplateReq extends BaseReq {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 模板ID
     */
    @Schema(description = "模板ID")
    @NotBlank(message = "模板ID不能为空")
    @Length(max = 50, message = "模板ID长度不能超过 {max} 个字符")
    private String templateCode;

    /**
     * 推送方式
     */
    @Schema(description = "推送方式")
    @NotBlank(message = "推送方式不能为空")
    @Length(max = 10, message = "推送方式长度不能超过 {max} 个字符")
    private String method;

    /**
     * 事件ID
     */
    @Schema(description = "事件ID")
    @NotBlank(message = "事件ID不能为空")
    @Length(max = 20, message = "事件ID长度不能超过 {max} 个字符")
    private String eventId;

    /**
     * 模板参数
     */
    @Schema(description = "模板参数")
    @Length(max = 200, message = "模板参数长度不能超过 {max} 个字符")
    private String params;

    /**
     * 模板内容
     */
    @Schema(description = "模板内容")
    @NotBlank(message = "模板内容不能为空")
    @Length(max = 200, message = "模板内容长度不能超过 {max} 个字符")
    private String content;

    /**
     * 链接地址
     */
    @Schema(description = "链接地址")
    @Length(max = 100, message = "链接地址长度不能超过 {max} 个字符")
    private String url;
}